package com.chuji.crmcj.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.chuji.crmcj.R;
import com.chuji.crmcj.utils.UIUtils;

/**
 * Created by w.pitt on 2016/1/11.
 */
public class RecToolsAdp extends BaseAdapter {

    private String[] mREcepNames = new String[]{"贷款计算器", "保险计算器", "车型库存"};
    private int[] mREcepImage = new int[]{R.drawable.i4, R.drawable.i5, R.drawable.i1};

    @Override
    public int getCount() {
        return mREcepNames.length;
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int position, View view, ViewGroup viewGroup) {
        view = view.inflate(UIUtils.getContext(), R.layout.item_function, null);
        TextView tvName = (TextView) view.findViewById(R.id.tv_name);
        ImageView ivIcon = (ImageView) view.findViewById(R.id.iv_icon);
        tvName.setText(mREcepNames[position]);
        ivIcon.setImageResource(mREcepImage[position]);
        return view;
    }
}
